package com.zxy.example.consumer;

import com.zxy.example.common.model.User;
import com.zxy.example.common.service.UserService;
import com.zxy.zxyrpc.bootstrap.ConsumerBootStrap;
import com.zxy.zxyrpc.model.ReferenceService;
import com.zxy.zxyrpc.proxy.ServiceProxyFactory;

/**
 * 配置类加载测试
 *
 * @author zxy
 * @since 2025/5/11
 **/
public class ConsumerExample {
    public static void main(String[] args) {
        /*RpcConfig rpc = ConfigUtils.loadConfig(RpcConfig.class, "rpc");
        System.out.println(rpc);*/
        ConsumerBootStrap.init();

        UserService userService = ServiceProxyFactory.getProxy(UserService.class,new ReferenceService());

        User user = new User();
        user.setName("zxy");
        User newUser = userService.getUser(user);
        if (newUser != null) {
            System.out.println(newUser.getName());
        } else {
            System.out.println("user == null");
        }
    }
}
